package com.maidou.qiantai.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.maidou.qiantai.mapper.OsOrderOperateHistoryMapper;
import com.maidou.qiantai.domain.OsOrderOperateHistory;
import com.maidou.qiantai.service.IOsOrderOperateHistoryService;

/**
 * 订单操作历史记录Service业务层处理
 * 
 * @author maidou
 * @date 2024-03-15
 */
@Service
public class OsOrderOperateHistoryServiceImpl implements IOsOrderOperateHistoryService 
{
    @Autowired
    private OsOrderOperateHistoryMapper osOrderOperateHistoryMapper;

    /**
     * 查询订单操作历史记录
     * 
     * @param id 订单操作历史记录主键
     * @return 订单操作历史记录
     */
    @Override
    public OsOrderOperateHistory selectOsOrderOperateHistoryById(Long id)
    {
        return osOrderOperateHistoryMapper.selectOsOrderOperateHistoryById(id);
    }

    /**
     * 查询订单操作历史记录列表
     * 
     * @param osOrderOperateHistory 订单操作历史记录
     * @return 订单操作历史记录
     */
    @Override
    public List<OsOrderOperateHistory> selectOsOrderOperateHistoryList(OsOrderOperateHistory osOrderOperateHistory)
    {
        return osOrderOperateHistoryMapper.selectOsOrderOperateHistoryList(osOrderOperateHistory);
    }

    /**
     * 新增订单操作历史记录
     * 
     * @param osOrderOperateHistory 订单操作历史记录
     * @return 结果
     */
    @Override
    public int insertOsOrderOperateHistory(OsOrderOperateHistory osOrderOperateHistory)
    {
        osOrderOperateHistory.setCreateTime(DateUtils.getNowDate());
        return osOrderOperateHistoryMapper.insertOsOrderOperateHistory(osOrderOperateHistory);
    }

    /**
     * 修改订单操作历史记录
     * 
     * @param osOrderOperateHistory 订单操作历史记录
     * @return 结果
     */
    @Override
    public int updateOsOrderOperateHistory(OsOrderOperateHistory osOrderOperateHistory)
    {
        osOrderOperateHistory.setUpdateTime(DateUtils.getNowDate());
        return osOrderOperateHistoryMapper.updateOsOrderOperateHistory(osOrderOperateHistory);
    }

    /**
     * 批量删除订单操作历史记录
     * 
     * @param ids 需要删除的订单操作历史记录主键
     * @return 结果
     */
    @Override
    public int deleteOsOrderOperateHistoryByIds(Long[] ids)
    {
        return osOrderOperateHistoryMapper.deleteOsOrderOperateHistoryByIds(ids);
    }

    /**
     * 删除订单操作历史记录信息
     * 
     * @param id 订单操作历史记录主键
     * @return 结果
     */
    @Override
    public int deleteOsOrderOperateHistoryById(Long id)
    {
        return osOrderOperateHistoryMapper.deleteOsOrderOperateHistoryById(id);
    }

    @Override
    public Integer deleteOsOrderOperateHistoryByOrderId(Long id) {

        return osOrderOperateHistoryMapper.deleteOsOrderOperateHistoryByOrderId(id);
    }

    @Override
    public Integer updateOsOrderOperateHistoryByOrderId(OsOrderOperateHistory osOrderOperateHistory) {
        return osOrderOperateHistoryMapper.updateOsOrderOperateHistoryByOrderId(osOrderOperateHistory);
    }
}
